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)

ElanaC 30-01-2010 19:02

solenoid with compressor vi
 
We are using the solenoid with compressor vi, and we were trying to get the compressor to run. The problem is that the compressor turns on when we enable the driver station, but turns off immediately. We can not figure out what is making that happen. Any help would be nice. We just want the compressor to turn on, run until 120 psi and then turn off. Then come back on again if it is below 120 psi. Why is it starting and stopping? :ahh:

Mark McLeod 30-01-2010 20:13

Re: solenoid with compressor vi
 
Anything interesting happening with the Robot Status Light (RSL) on the Digital Sidecar? It should be mostly on for a second or two, with a very brief blink off.
Any messages on the Driver Station Diagnostics tab?

There are status LEDs next to the Digital Sidecar Relays where you should be controlling your compressor from. These will tell you if it's a code problem or a hardware problem.

What do the LEDs next to your PWM connection to the Spike controlling the compressor show?
LED off - means the code has turned off the compressor
LED on - means the code wants the compressor on

Is the Spike status light orange or green/red while this is happening?

Alan Anderson 30-01-2010 23:16

Re: solenoid with compressor vi
 
Quote:

Originally Posted by ElanaC (Post 910157)
We just want the compressor to turn on, run until 120 psi and then turn off. Then come back on again if it is below 120 psi. Why is it starting and stopping? :ahh:

Tell us how you have the compressor and pressure switch connected, both electrically and pneumatically. Show us how your code is controlling it. Then we might be able to tell you why it's doing what it's doing. We might also be able to tell you if there's something you should change to make it do what you want it to.

AmandaMay 31-01-2010 16:34

Re: solenoid with compressor vi
 
So we checked the diagnostics tab and it says that our watchdogs have expired, we are not sure what this means, or what to do. They continue to expire 1-13 some of them expire twice. I am a programmer on the team.

Mark McLeod 31-01-2010 17:18

Re: solenoid with compressor vi
 
Don't worry about the Watchdogs too much for now. They have have some odd behavior that NI is working to make better.

Using the Solenoid with compressor example, do you start it from the front panel?

Are you running the Driver Station in the same Developer account where you have LabVIEW running? Don't switch user accounts to run the Driver Station.

AmandaMay 31-01-2010 17:31

Re: solenoid with compressor vi
 
We are running it from the front panel and we don't switch accounts. We tried "run continuously" with the same result. The compressor still turns off. The light on the digital sidecar turns off as soon as we enable the code. and we don't have any lights next to our PWM connection to the Spike controlling the compressor. :confused:

Mark McLeod 31-01-2010 17:38

Re: solenoid with compressor vi
 
Quote:

Originally Posted by AmandaMay (Post 910746)
The light on the digital sidecar turns off as soon as we enable the code, and we don't have any lights next to our PWM connection to the Spike controlling the compressor. :confused:

The Digital Sidecar status (RSL) going off is why the compressor stops.
If the RSL is off, nothing will run.
Do the other voltage status LEDs on the Digital Sidecar look good?
It could be a wiring short circuit with something attached to the Digital sidecar that makes it shutdown.

When the RSL goes off what does the Driver Station statuses show then?

AmandaMay 31-01-2010 17:50

Re: solenoid with compressor vi
 
The only light that ever comes on on our digital sider car is the one labeled 5v I don't know if that's the RSL you are talking about.
6v and bat never turn on.
The driver station doesn't change except the watchdog errors.

Mark McLeod 31-01-2010 17:54

Re: solenoid with compressor vi
 
Well there's a problem.

Do you have the Digital Sidecar power wired to the Power Distribution Panel?
It needs one of the loose white Wago connectors on one end, and the other end of the wires go into a set of the small red/black Wago connectors on the Power Distribution Panel.

I'll see if I can find a photo...

AmandaMay 31-01-2010 18:07

Re: solenoid with compressor vi
 
We don't think we do have our digital sidecar wired to the power distribution board. it is wired to the Crio throuh the ribbon cable. A photo would be great. My programming team has recently been trying to do all of the wiring as well as programming and we are a little confused.

Mark McLeod 31-01-2010 18:24

Re: solenoid with compressor vi
 
1 Attachment(s)
Here's what it should look like when it's operating correctly.

The power LEDs on the left should all be on.
The Robot Status LED (RSL) is the really bright one on the other side of the power connector.

As a programmer, the RSL is the light you look at first.
off = off
blinking = disabled
long on/short off = teleop
solid = autonomous

AmandaMay 31-01-2010 18:24

Re: solenoid with compressor vi
 
Thank you a bunch Mark. Our coach helped with the wiring for the side car and we have it doing what we needed!! We are very thankful for your assistance. I am a little embarrassed that I did not realize that was our problem. :o

AmandaMay 31-01-2010 18:25

Re: solenoid with compressor vi
 
New mission, make the festo work :)

Mark McLeod 31-01-2010 18:30

Re: solenoid with compressor vi
 
More wiring for the programmers...:)

umangv620 07-02-2010 09:43

Re: solenoid with compressor vi
 
Hey i was just wondering how did you code the pressure switch. Is there a sub Vi for that? I have the spike working, and I need the pressure switch to turn the air compressor on and off.

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...

Joe Ross 13-02-2010 23:52

Re: solenoid with compressor vi
 
One thing I noticed is that you're opening and closing your robot drive in teleop, plus you still have references to the default robot drive in telop. You probably have conflicts in PWM assignments doing that. You also shouldn't be opening and closing hardware like that, as telop is called 50 times per second. You should open it and save the device reference in begin. In teleop you should get the device reference and do something with it. It should be closed in finish.

umangv620 14-02-2010 00:26

Re: solenoid with compressor vi
 
Quote:

Originally Posted by Mark McLeod (Post 919513)
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...

I used tinypic. next time, ill just upload a zip file so everyone can access it.

Quote:

Originally Posted by Joe Ross (Post 919720)
One thing I noticed is that you're opening and closing your robot drive in teleop, plus you still have references to the default robot drive in telop. You probably have conflicts in PWM assignments doing that. You also shouldn't be opening and closing hardware like that, as telop is called 50 times per second. You should open it and save the device reference in begin. In teleop you should get the device reference and do something with it. It should be closed in finish.

Thats what we had. We had all that, and the only errors we were getting from the driver station were the watchdog errors. This was good, except that tank drive was not functioning properly(meaning each joystick controls its own jaguar which moves the motor its connected to).

I guess we are just having errors somewhere when everything is being referenced. maybe some other code is screwing around the data for the references because when we use joystick references instead of just opening joysticks on a USB port, tank drive screws up(I am sure i wrote this before, but ill do it once again. When i say tank drive screws up, i mean that in light bulb mode, the joysticks are giving the correct values[joystick 1 turns left motor, joystick 2 turns right motor]. When we run the code on the robot, Joystick 1 controls both motors and joystick 2 looses control of motor 2(it regains control for half a second randomly)

It would be really helpful if you could post or PM me some sample code(we dont have any examples installed in labview for some reason) that we could work off of.

Mark McLeod 14-02-2010 10:59

Re: solenoid with compressor vi
 
I can see it at home.

Your Begin.vi code looks good. The only danger is we can't see if you are opening multiple things like "USB 1" and "Drive Motors".
P.S. One mistake is you open two different devices on Relay 1.

Your basic Teleop.vi code looks okay too, except for what Joe commented on.

The Compressor code in Robot Main.vi doesn't actually do anything. It can be removed and you wouldn't notice any difference in operation.
I'd refrain from adding anything at all to Robot Main on general principle.

I'm with Joe on the duplicate drive code. Without seeing the full Begin.vi it looks like you probably have a conflict where sometimes your code wins control and sometimes the default drive code you left in the False case in the top part wins control.

If you're not using the default targeting code I'd recommend you just delete it from Teleop.
In Begin clean up opening the drive motors twice and any multiple Opens on joysticks you might have.

I'll see if I can post a cleaned up version of your code later after lunch and a trip to Lowe's for bumper plywood and aluminum tubing.

furiousgeorge 14-02-2010 13:15

Re: solenoid with compressor vi
 
we were having this same problem of the compressor turning on and then immediately off as soon as the robot was enabled. now the compressor does not turn on at all. after reading several other posts i noticed that our relay leds on our digital side car are not lighting up and the led on our spike stays orange, it has never changed colors, i've tried fliping the pwm cable around but that seems to not have made any difference. we are using the example vi from labview to try to run this compressor and cylinder. does any one have any suggestions on how to get the relay to start working?

Mark McLeod 14-02-2010 16:43

Re: solenoid with compressor vi
 
5 Attachment(s)
I copied your code into a new copy of the default robot project.
Robot Main.vi is left in it's original untouched state.
All Opens are done in Begin.vi
All Closes are in Finish.vi
All uses are in Teleop.vi

I got rid of the duplicate drive motors and fixed the duplicate relays.

Alan Anderson 14-02-2010 17:59

Re: solenoid with compressor vi
 
Quote:

Originally Posted by Mark McLeod (Post 919966)
I got rid of the duplicate drive motors and fixed the duplicate relays.

I see PWM2 being used for both the right drive motor and the camera base servo. That'll have to be fixed before Mark's code will do what is intended.

umangv620 18-02-2010 18:18

Re: solenoid with compressor vi
 
Ok, we now have Tank Drive running in Teleop(The problem was that we didn't realize that there was Arcade drive code in the Teleop.vi which was screwing around with our tank drive. I fixed it, so its working now.

Now back to the thread.
I have very minimal solenoid code in LabView atm. I have a Solenoid Get Ref outside the Robot Main loop, and a Front Panel Boolean switch wired to the Solenoid Set inside the Teleop loop in Robot Main.

When we run the code(when i click on the boolean switch to go from false to true), the solenoids doesn't fire the piston-type-firing-thing(no clue what its called). We know the solenoid works mechanically because we can press the button to release the air into the piston thing, and it fires.

my begin vi looks very similar to mark's code. We have the solenoid we are testing in slot 1 on module 8, so wiring is not the problem.

Alan Anderson 18-02-2010 22:13

Re: solenoid with compressor vi
 
Quote:

Originally Posted by umangv620 (Post 923297)
I have very minimal solenoid code in LabView atm. I have a Solenoid Get Ref outside the Robot Main loop, and a Front Panel Boolean switch wired to the Solenoid Set inside the Teleop loop in Robot Main.

That won't work the way you think it will. The RefNum Get is very likely going to be executed before Begin.vi has done its RefNum Set, so the reference you're passing to the Solenoid Set will be invalid.

I strongly advise you to leave Robot Main the way it started. Don't change it from its default. When you want to add code, do it in the Begin, Teleop, and Finish vi's, and maybe in the Periodic Tasks. Your solenoid code should be right next to your drive code in Teleop.

Team1268 20-02-2010 23:30

Re: solenoid with compressor vi
 
Hello All,

We've been having some problems with the compressor vi's. We've followed the solenoid with compressor example and

are trying to do pretty much the same thing.

We are putting the Compressor Open.vi in BEGIN and assigning a refnum to it. Then in Teleop.vi we do refnum get

and inside the execute loop we have the refnum get wired to compressor start and compressor enable. We've changed

around where we put the start and enable vi's- whether to go inside the loop or if they only need to be called

once.

When we look into the block diagrams of the open vi, it seems that this is where all the inputs get read, logic is

processed, and outputs set. The other compressor vi's seem only to do monitoring and fifo stuff which we don't

mess with. In the example, the compressor Open.vi is not in the loop and the only vi's in the loop seem to change

the monitoring feedbacks.

Where should I put the compressor Open.vi? Where are the other vi's supposed to go? DO WE NEED the other vi's?

The programming manual says 'After you open a reference to a compressor, you can use the start and stop vi's...'

but the block diagrams for the start and enable vi's don't have anything to do with reading DIO get or relay SET.

In the Dashboard I can see the IO channel change state when I short together wires (for a long time) simulating

the contact closure/opening of the pressure switch. Just outputs never get set - the relay LEDs on the sidecar

don't light, spike relay doesn't change colors, and in hilight execution it doesn't show the action taking place

within the compressor open.vi

We ran the simple relay example successfully and our solenoids are working elsewhere in the program.

any help is greatly appreciated!!



Team 1268 WHS Purgolders

Mark McLeod 21-02-2010 00:04

Re: solenoid with compressor vi
 
The examples have a lot of things we don't need.
As you noticed, the Enabled vi just tells us if the compressor is running or not.

The necessary compressor vi's are just the Open and Start in Begin.vi.
They only need to be called that one time, not repeatedly.
It's also good technique to close the compressor in Finish.vi, but it's not absolutely necessary in this case.

Rangel 27-12-2010 16:26

Re: solenoid with compressor vi
 
1 Attachment(s)
Hello, I have a similar problem. I have the same goal that involves turning the compressor on when below 120 psi and turning it off when it reaches it. The code seems to be exactly the same as the images posted. Problem is that the compressor stays on forever. What am I missing that turns the compressor off? I have attached screenshots of my code to a zip file.

Joe Ross 27-12-2010 18:55

Re: solenoid with compressor vi
 
Is your pressure switch working and connected to DIO 14? On the dashboard, do you see DIO 14 change when the pressure reaches 120?

Rangel 29-12-2010 13:38

Re: solenoid with compressor vi
 
Quote:

Originally Posted by Joe Ross (Post 988847)
Is your pressure switch working and connected to DIO 14? On the dashboard, do you see DIO 14 change when the pressure reaches 120?

It seems that I had the wrong version of my team's pin-out. It was supposed to be connected to DIO 8. It is working fine now.

Thanks


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