Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Help with WindRiver pneumatics code (http://www.chiefdelphi.com/forums/showthread.php?t=91949)

Matthew Blake 15-02-2011 21:13

Help with WindRiver pneumatics code
 
Hi all, it's our rookie year in FRC and we have been struggling to figure out how to make the pneumatics run. There is no example code in WindRiver to help us figure this out; any sort of sample code or guidance would be appreciated. We have two solenoids, two outputs to the actuators, and one air input.

jwakeman 16-02-2011 08:36

Re: Help with WindRiver pneumatics code
 
Here's a start http://www.chiefdelphi.com/forums/sh...ad.php?t=91789

ScaliToast 16-02-2011 11:16

Re: Help with WindRiver pneumatics code
 
You can find code examples for various robot hardware components in the "WPI Robotics Library Users Guide". Look for Pneumatics in the T-O-C. It gives an overview of the Compressor and Solenoid objects.

This document is available at the FIRST Forge site, WPI project documents section. The link is:
http://firstforge.wpi.edu/sf/docman/..._documentation


Good luck!

taichichuan 16-02-2011 18:45

Re: Help with WindRiver pneumatics code
 
1 Attachment(s)
Hi Teams!

Ask and ye shall receive. This is a very simple program that exercises solenoids 1-6 on slot 8 and 1-5 on slot 7 (I only had 11 buttons on my joystick). It also turns on the compressor and allows for control of the compressor. It's pretty basic, but it should give you a leg up.

Enjoy,

Mike

Matthew Blake 17-02-2011 00:34

Re: Help with WindRiver pneumatics code
 
Thanks for this code!

mutantblond 21-03-2011 17:50

Re: Help with WindRiver pneumatics code
 
hi,
I'm still confused after reading these examples. we're trying out pneumatics code also - it goes as follows:
arm_button1 = arm_stick.GetRawButton(1);
if (arm_button1)
{
s1.Set(0);
s2.Set(1);
}
else
{
s1.Set(1);
s2.Set(0);
}
I've declared s1 and s2 as Solenoids under the Class section, and initialized them as s1(1,1) and s1(1,2) in the Public section. But they are connected to pins 1 and 2 on the Digital Output Module. Which numbers in parentheses refer to the pins of the DOM? How can we trouble shoot this? we're not getting any response when we press button 1 on our joystick.

mutantblond 21-03-2011 17:51

Re: Help with WindRiver pneumatics code
 
some further comments - we are getting 12 V to the Solenoid break-out - the LED is lit up.

taichichuan 21-03-2011 18:23

Re: Help with WindRiver pneumatics code
 
If you're seeing the solenoid bumper LED come on, then you're doing everything right as far as the software is concerned. Now, you've got to trace the wiring from the bumper to the actual solenoid switch. If that's correct, you should hear a click as the the solenoid is engaged. From there, it's all about the pneumatics plumbing, pressure switch, etc. I'm not the pneumatics guy. So, once it's bits on the wire, it's a hardware problem ;-).

Mike

mutantblond 22-03-2011 12:29

Re: Help with WindRiver pneumatics code
 
we're trying to use a 24V Festo solenoid for some reason, which we are switching out today.

Alan Anderson 22-03-2011 14:49

Re: Help with WindRiver pneumatics code
 
Quote:

Originally Posted by mutantblond (Post 1043331)
I've declared s1 and s2 as Solenoids under the Class section, and initialized them as s1(1,1) and s1(1,2) in the Public section. But they are connected to pins 1 and 2 on the Digital Output Module. Which numbers in parentheses refer to the pins of the DOM?

The first number in parentheses is the module number. Solenoid modules are only supported in cRIO slots 8 and 7. You should probably be initializing them as s1(8,1) and s1(8,2) instead.

mutantblond 22-03-2011 15:58

Re: Help with WindRiver pneumatics code
 
what are you talking about when you say the 'solenoid bumper LED'? is this different from the LED on the board showing that it's getting power? we switched out the solenoid, but it's still not 'clicking' when we press the appropriate button (1, in this case) on the joystick.

mutantblond 22-03-2011 16:22

Re: Help with WindRiver pneumatics code
 
Alan, we have the solenoid valves connected to pins 7 and 8 of the solenoid break-out board. I have the Solenoid declaration for s1 and s2 in the Class section, then s1(8,1) and s1(8,2) declared in the public section - something doesn't seem right here - how does pin 7 enter into it?

Alan Anderson 22-03-2011 16:51

Re: Help with WindRiver pneumatics code
 
When you supply two numbers to a solenoid initialization, the first one specifies the module number and the second one specifies the output pin number. There are eight slots in the FRC-cRIO chassis. Slots 1 and 2 support analog input modules. Slots 4 and 6 support digital I/O modules. Slots 7 and 8 support digital sourcing modules, which are used to control solenoids. Each solenoid breakout has eight outputs, numbered 1-8 (though the eight green LEDs on the module are actually labeled 0-7, giving a potential cause for confusion).

s1(8,1) defines the solenoid object as being associated with pin 1 of the pneumatics breakout connected to a digital sourcing module in slot 8 of the cRIO.

s1(8,2) defines the solenoid object as being associated with pin 2 of the pneumatics breakout connected to a digital sourcing module in slot 8 of the cRIO.

mutantblond 22-03-2011 17:00

Re: Help with WindRiver pneumatics code
 
so we had the wrong module in the crio - we've now put the 9472 in - and we see the lights for pins 7 and 8 flashing as we pull the trigger on our joystick. But there's no juice getting to the solenoid. I made a type in my previous email, we're initializing s1(8,1), s1(8,2). i'm still puzzled about how this works when we've got the solenoid valves connected to pins 7 and 8.
sorry, the WPI LIB comments are not that helpful since they are using pointers. i'm not much of a C++ programmer.

Arthur3103 22-03-2011 20:24

Re: Help with WindRiver pneumatics code
 
Are you running 12V or 24V solenoids? If 12V, you need to power the solenoid breakout from a 20A circuit from the power distribution board. If 24V, you need to power the solenoid breakout from the 24V header on the power distribution board (the same header the cRIO is powered from).

If you are powered properly: each solenoid has a manual button. Press the button with a small screwdriver or other pointed object. If the solenoid works, it is getting air and electrical power -- the problem is in your code. If the solenoid does not work, or no lights light up, you probably have a wiring problem. Have you done a continuity check of your wiring? Try reversing the two-wire connector on the solenoid breakout.

Good luck.


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

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