Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Proper way to connect a solenoid (http://www.chiefdelphi.com/forums/showthread.php?t=118297)

rkoripalli 07-08-2013 12:55

Proper way to connect a solenoid
 
My team is adding t-shirt cannons to our robot for the offseason, and we are using sprinkler valves as solenoids to fire them. We have little experience with pneumatics, we managed to get the compressor working with no trouble; however, we don't know the proper way to connect the solenoid so that we can fire. We tried connecting it to a Spike and switching the spike on, but it was unsuccessful. What is the correct way to do this?

gr8dragon 07-08-2013 13:12

Re: Proper way to connect a solenoid
 
There is a solenoid module and breakout for the cRio (much like the analog) to which solenoid can be connected. Inside of the program they will need to be fired using the Solenoid class.

daniel_dsouza 07-08-2013 13:15

Re: Proper way to connect a solenoid
 
A spike should work for a typical valve.

Check to make sure that you can actuate the solenoid in the first place (with a battery).

Check the specs for your valve. Does it use 12V, or 24V (unlikely)?

Did you code it correctly? If you are not sure, look at the colors on the spike. It should change between red and green for reverse and forward. Yellow means that it isn't doing anything

this has been on our team's bucket list for some time too, but we never get around to it.

rkoripalli 07-08-2013 13:20

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by gr8dragon (Post 1286227)
There is a solenoid module and breakout for the cRio (much like the analog) to which solenoid can be connected. Inside of the program they will need to be fired using the Solenoid class.

Thanks, we will definitely try that, we would've done that earlier, but we are in the process of moving all of our parts so we don't have the breakout right now.

magnets 07-08-2013 13:30

Re: Proper way to connect a solenoid
 
If you're using valves that aren't the typical FRC type (like sprinkler valves), I'd recommend using a spike relay instead of the solenoid module/breakout. Then you would use the relay class/vi instead of the solenoid one when you program it.

bardd 07-08-2013 13:30

Re: Proper way to connect a solenoid
 
Like Daniel said, you should start by seeing if it's working. You don't need to connect the solenoid to a battery for that.
If you look at the solenoid, you should find that it has to small buttons on top. Pressing them triggers the solenoid, there's one button in charge of opening each output. Note, this only works when the system is pressurized and there's no place for the air to escape through other than the solenoid's release openings. Leaks won't interfere with the test as long as they're not huge, so don't worry about making it super-secure (save your teflon for the actual system). I can't find a photo right now, I'll keep looking.
Hook it up to a system with a piston (one input tube coming from the compressor, either directly or through a regulator, two output tubes, one to each side of the piston). Start the compressor with a battery. When it's pressurized, press a button and see if the piston works. If not, press the other. If it still doesn't work, you have a faulty solenoid.

As for wiring, it's usually best to use the cRIO's relay module like parth suggested. You can use a spike if you want, but then you have to have one for each side so you can both open and close. You'd still have to wire both sides with the cRIO, but it's way easier since both connections are already there. Make sure you got polarity right! Polarity is confusing in solenoids, more than other electrical components you often use.

Could you post a picture of the system? Maybe there's a problem we can't find with your description, but we could see in a picture.

tr6scott 07-08-2013 13:31

Re: Proper way to connect a solenoid
 
Most sprinkler valves I have seen are 24v AC (Alternating Current) like the power in your house. The robot runs on 12V DC, and the power distribution board also has a 24V DC power supply built in to run the cRio.

I did do some searching around, and it appears that there are AC valves that actually work with DC, but may or may not work with the valve you have. (http://www.avrfreaks.net/index.php?n...wtopic&t=75553)

(Remember applying voltages to components outside their specifications you are risking failure, and if on a production bot, would not pass inspection) This is not a smart decision, but it may work.

So you can test straight with 12v or 24v dc power and see if it works, if it does, then you can look at making it work from the bot.

As for wiring with a spike, review team 358 documents here. http://team358.org/files/pneumatic/P...RIOversion.pdf

I could cut and paste the diagram here, but they have done the hard work and deserve the credit. :)

rkoripalli 07-08-2013 13:31

Re: Proper way to connect a solenoid
 
Also, is there some time of sensor that gives feedback on what psi the compressor is at? We want to be able to adjust how far we can shoot the shirts by changing how much pressure is in the tanks.

rkoripalli 07-08-2013 13:35

Re: Proper way to connect a solenoid
 
I can say that the solenoid does work, we were able to fill up the air tanks with the compressor, and fire a t-shirt a very good distance by connecting the solenoid directly to a battery

rkoripalli 07-08-2013 13:41

Re: Proper way to connect a solenoid
 
I've found out that it is in fact a 24v valve, what would you guys suggest based on that?

bardd 07-08-2013 13:44

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by rkoripalli (Post 1286235)
I've found out that it is in fact a 24v valve, what would you guys suggest based on that?

As far as I know, there's no way of getting 24V except hogging the cRIO's power, and I wouldn't suggest that. Is there a way for you to get a 12V one?

magnets 07-08-2013 13:51

Re: Proper way to connect a solenoid
 
If you were able to successfully operate the valve using the KoP 12V battery, you should be able to do it with a spike relay, wired the same way your compressor is set up.

tr6scott 07-08-2013 13:53

Re: Proper way to connect a solenoid
 
From the link I posted, they were talking that they were reliably firing the solenoids with 9vdc batteries, so I would wire it with a spike to the 12v battery. Let it run, and monitor how warm it gets, just to watch for early failure.

Not sure how much to spend on an analog pressure sensor, but we use these in industry. http://www.ifm.com/products/us/ds/PN2024.htm with good success.

rkoripalli 07-08-2013 13:54

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by bardd (Post 1286236)
As far as I know, there's no way of getting 24V except hogging the cRIO's power, and I wouldn't suggest that. Is there a way for you to get a 12V one?

As of right now we're open to anything. We're actually planning on building 4 cannons, but we only have one right now. If its possible we would like to get the 24v one working though

bardd 07-08-2013 13:59

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by rkoripalli (Post 1286245)
As of right now we're open to anything. We're actually planning on building 4 cannons, but we only have one right now. If its possible we would like to get the 24v one working though

Working with the 24V isn't different than 12V, and like Scott said, if it worked with the battery it'll work on the robot. The thing is since you're not using the solenoid's specifications it might fail or work poorly. Also, it's bad practice to not supply the component's specifications, that's why I suggested getting another.

Other than the tips in my original post, there's not much I can say, based on your description. Do you think you could post a picture of the system you built?

rkoripalli 07-08-2013 13:59

Re: Proper way to connect a solenoid
 
Do you guys know of a way to use a non spike relay on the bot? We only have two working ones and one is on the compressor, we want to have 4 cannons and our team is short on cash so we really don't want to spend the $35 for each new spike

rkoripalli 07-08-2013 14:02

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by bardd (Post 1286247)
Working with the 24V isn't different than 12V, and like Scott said, if it worked with the battery it'll work on the robot. The thing is since you're not using the solenoid's specifications it might fail or work poorly. Also, it's bad practice to not supply the component's specifications, that's why I suggested getting another.

Other than the tips in my original post, there's not much I can say, based on your description. Do you think you could post a picture of the system you built?

I won't be able to post a picture today because I don't have access to the robot right now. It's at another members house,I'll ask him to post one later today

rkoripalli 07-08-2013 14:18

Re: Proper way to connect a solenoid
 
In terms of code, I am using Java commandbase. I have "public static Relay cannon = new Relay(4);" in RobotMap. I also have a command setup to fire. In the initialize i'm doing "RobotMap.cannon.set(Relay.Value.kOn);" where cannon is the name of the Relay and RobotMap is the place where it is defined. I can verify that the command is running because I have a debug statement which is printing when I push the button to run it.

Joe Ross 07-08-2013 14:37

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by rkoripalli (Post 1286253)
In terms of code, I am using Java commandbase. I have "public static Relay cannon = new Relay(4);" in RobotMap. I also have a command setup to fire. In the initialize i'm doing "RobotMap.cannon.set(Relay.Value.kOn);" where cannon is the name of the Relay and RobotMap is the place where it is defined. I can verify that the command is running because I have a debug statement which is printing when I push the button to run it.

Using kOn is turning both sides of the relay on, which won't cause the solenoid to fire. You want to use kForward which sets the + side to 12v and the - side to ground.

Alternately, you can set the direction to forward in the constructor and then use kOn.

rkoripalli 07-08-2013 14:43

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by tr6scott (Post 1286244)
From the link I posted, they were talking that they were reliably firing the solenoids with 9vdc batteries, so I would wire it with a spike to the 12v battery. Let it run, and monitor how warm it gets, just to watch for early failure.

Not sure how much to spend on an analog pressure sensor, but we use these in industry. http://www.ifm.com/products/us/ds/PN2024.htm with good success.

I'm reading that spikes can only switch 12v, which is why I believe that it didn't work for us.

You mentioned earlier, and I'm reading here http://team358.org/files/pneumatic/ that 24v solenoids can be run through the cRIO power. Are you familiar with how this is done?

rkoripalli 07-08-2013 14:46

Re: Proper way to connect a solenoid
 
Quote:

Originally Posted by Joe Ross (Post 1286258)
Using kOn is turning both sides of the relay on, which won't cause the solenoid to fire. You want to use kForward which sets the + side to 12v and the - side to ground.

Alternately, you can set the direction to forward in the constructor and then use kOn.

Sorry, I forgot to mention that after kForward didn't work I switched it to kOn. Thank you though, I will change it back now

tr6scott 07-08-2013 15:04

Re: Proper way to connect a solenoid
 
oOPS Double post.

tr6scott 07-08-2013 15:07

Re: Proper way to connect a solenoid
 
[quote=tr6scott;1286265]
Quote:

Originally Posted by rkoripalli (Post 1286261)
I'm reading that spikes can only switch 12v, which is why I believe that it didn't work for us.

But you said the valve worked by direct connecting to the battery, so it should work with the spike connected to 12v power.

I understand you don't want to use the spikes due to the cost, and if you need 4 of them. Why I suggested them, is they are very robust, and fused, which is nice when you are putting stuff together outside of specifications.

This diagram, http://team358.org/files/programming...ionDiagram.pdf shows two solenoid cards, one is powered by 24vdc and one is powered by 12vdc.

As you already stated that 12vdc worked, I would suggest that you wire to 12v to test, this is because we are working outside of specs, and if something goes, you may blow the 24vdc power supply in the power distribution board, and the cost money too.

Here is the manual to the solenoid breakout, http://www.usfirst.org/sites/default...20Breakout.pdf You will need a 2 pin pwm cabel, wired to the solenoid + to + ground to ground. When you turn on the output in the program the solenoid will fire with the voltage that you apply to power input terminals.

Hugh Meyer 07-08-2013 15:31

Re: Proper way to connect a solenoid
 
1 Attachment(s)
The 24 volt AC sprinkler valves that we used would not work on 12 VDC with pressure. They need about 18 volts to fire. You may have a similar issue.

You should connect them to the pneumatic breakout with that module being powered with 24 VDC as shown in the diagram Scott linked to in the thread above this.

We have done this for several years and it works fine.

Attached is an updated version of the same drawing. It shows how to get power for a 24 volt solenoid and this is even legal. Your circuit is fully protected.

I would suggest installing diodes across the coil to absorb the back EMF from the coil. Here is a link that explains. You can leave out the resistor.

http://en.wikipedia.org/wiki/Flyback_diode

You should see the green lights on the module change when you trigger the valve. Remember, you need a short pulse, about 0.5 second is good, so your code will need to make that pulse with a small state machine or you could just connect it to a button on the joystick and let the operator create the short pulse.

Have fun!

-Hugh

gr8dragon 09-08-2013 16:01

Re: Proper way to connect a solenoid
 
One thing that you can do to get the 24 V that you need is share the power with the cRio. This is something that teams have done in the past I believe. The port off the PD board that you wire to power the cRio, there are 4 wire holes there, you can draw and extra wire from it to power the solenoid breakout panel.

There are probably some concerns with this. I would not recommend using this method and mixing 12V and 24V solenoids. Some people would not use this method at all.


All times are GMT -5. The time now is 21:19.

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