Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Pneumatics (http://www.chiefdelphi.com/forums/forumdisplay.php?f=54)
-   -   Help programming pneumatics (http://www.chiefdelphi.com/forums/showthread.php?t=144482)

itwasntme455 22-02-2016 23:38

Help programming pneumatics
 
This is our teams first time using pneumatics. We have everything hooked up but are having issues with the programming part using LabVIEW. We would like the piston to extend when button "A" is pressed and retract when button "A" is released. How would we achieve this. Thanks in advance!

Noviv 23-02-2016 00:05

Re: Help programming pneumatics
 
You will just need to set the value of the pneumatic to one position while the button is being pressed, and the other when it is not.

Psuedocode:
Code:

if (A button is pressed) {
    pneumatic.set(on);
} else {
    pneumatic.set(off);
}

Java Single Solenoid:
Code:

Solenoid solenoid = new Solenoid(port);
if (operator.getRawButton(1)) {//example
    solenoid.set(true);
} else {
    solenoid.set(false);
}

Java Single Solenoid:
Code:

DoubleSolenoid solenoid = new DoubleSolenoid(portA, portB);
if (operator.getRawButton(1)) {
    solenoid.set(DoubleSolenoid.Value.kForward);
} else {
    solenoid.set(DoubleSolenoid.Value.kReverse);
}

getRawButton(1) should be mapped to the A button on Xbox controllers. Switch it to getRawButton(2) for Logitech controllers.

itwasntme455 23-02-2016 00:21

Re: Help programming pneumatics
 
How about in LabVIEW?

Noviv 23-02-2016 02:02

Re: Help programming pneumatics
 
Sorry, my team has only used C++ and Java. Here are a few links that might be helpful:

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

http://www.team476.com/wpimages/wp1798b5a5_05_06.jpg

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

I hope this helps!

thatnameistaken 23-02-2016 03:26

Re: Help programming pneumatics
 
Quote:

Originally Posted by itwasntme455 (Post 1544805)
How about in LabVIEW?

Like so:


In the false state of the case structure in Teleop, the solenoid must be set to reverse instead of forward. Additionally, in Begin, make sure your PCM ID and solenoid channels match how you wired your robot; the forward channel is the channel wired to the end of the solenoid connected to the part of the piston further from the rod, while the reverse channel should be set to the closer end. If you're unsure, just guess and switch it if it's backwards.

Mark McLeod 23-02-2016 09:37

Re: Help programming pneumatics
 
1 Attachment(s)
Here's another example


All times are GMT -5. The time now is 05:52.

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