|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Can't get Solenoid to fire?
Hi! We have spent many hours trying to get our Double Solenoid to work but all attempts have ultimately failed. We get green lights on the card in the CRIO slot showing us that it does have signal. The Solenoid is yellow on both sides and is 12V which is the voltage we are giving it. There is no clicking or any evidence the solenoid is bad or can't fire. We tried many other solenoids without luck. Any help will be greatly appreciated! Code:
Code:
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
public class RobotTemplate extends SimpleRobot {
private final Joystick DriverStick,other; //defines Axis Camera
private final DoubleSolenoid s1;
RobotDrive myDrive;//defines solenoids
private boolean orange;
public RobotTemplate() {
myDrive = new RobotDrive(3,2);
DriverStick = new Joystick(1);
Compressor airCompressor;
airCompressor = new Compressor(14,7);
airCompressor.start();
other = new Joystick(2);
s1 = new DoubleSolenoid(3,8);
}
public void operatorControl() {
while (isOperatorControl() && isEnabled()){
myDrive.tankDrive(other, DriverStick);
if(DriverStick.getRawButton(1) == true)
{
s1.set(DoubleSolenoid.Value.kReverse);
}
if(DriverStick.getRawButton(2) == true)
{
s1.set(DoubleSolenoid.Value.kForward);
}
}
}
}
}
|
|
#2
|
|||||
|
|||||
|
Re: Can't get Solenoid to fire?
You specified that you are using the cRIO. Are you using the 2014 version of wpilib? My understanding is that there are enough changes from cRIO to roboRIO that the 2015 version does not work on the old hardware.
|
|
#3
|
|||||
|
|||||
|
Re: Can't get Solenoid to fire?
Programming:
|
|
#4
|
||||
|
||||
|
Re: Can't get Solenoid to fire?
Brute force: always try manually pushing the blue button on the solenoid to see if the mechanism is able to work.
|
|
#5
|
|||||
|
|||||
|
Re: Can't get Solenoid to fire?
That's a good point.
Make sure there is sufficient pressure for the solenoid to activate (>20 or 25psi). |
|
#6
|
||||
|
||||
|
Re: Can't get Solenoid to fire?
The LEDs do alternate and when I press the blue button, the piston fires. I haven't checked the voltage yet on the wires so I will the next time. The only thing I see from I what you said is that the solenoid is yellow on both sides which you said wasn't supposed to happen. How can I fix this problem? Thanks for all the replies!
|
|
#7
|
||||
|
||||
|
Re: Can't get Solenoid to fire?
I'm not a programmer, but I think you've got an issue of no "else" statement. It would seem if button 1 is pressed, then button 2, both solenoids would be getting the "go" signal.
My extent of programming help ended when my old team using labview 4 years ago. So if you're shaking your head in disgust at my theory, I am sorry! ![]() |
|
#8
|
|||||
|
|||||
|
Re: Can't get Solenoid to fire?
No "else" is necessary. The last "set" wins.
The code just works out that button 2 wins any tie, and in a tie the solenoid just gets set twice, but so fast that the system won't even notice. Having both yellow signal lights on means both sides are energized and attempting to pull in opposing directions. So the solenoid shouldn't move from whatever position it is current in. The yellow solenoid signal lights for each side should only light when they have power and consequential are active, otherwise they don't get power to even light the signal light. If the solenoid module is showing green for one of the sides (power on), and dark for the opposite side (power off), then the corresponding signal lights should be yellow and dark. So there seems to be some sort of short sending power to the wrongly lit side of the solenoid. Either wires are crossed or the solenoid module is powering output pins when it shouldn't be. Use your meter to verify that power is indeed getting to what should be the unpowered side. Test at the solenoid module pins without the solenoid connected. Last edited by Mark McLeod : 18-06-2015 at 22:51. |
|
#9
|
|||||
|
|||||
|
Re: Can't get Solenoid to fire?
Edit: I see Mark beat me to this, and knows more authoritatively.
Quote:
I have not worked with the pneumatics methods (only mentored programming in 2015, and we didn't use pneumatics), but if it's anything like the spike methods (which we did use for LEDs), setting kForward and kReverse automatically clear the other side. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|