|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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.
|
|
#2
|
|||
|
|||
|
Re: Help with WindRiver pneumatics code
Here's a start http://www.chiefdelphi.com/forums/sh...ad.php?t=91789
|
|
#3
|
||||
|
||||
|
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! |
|
#4
|
||||
|
||||
|
Re: Help with WindRiver pneumatics code
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 |
|
#5
|
||||
|
||||
|
Re: Help with WindRiver pneumatics code
Thanks for this code!
|
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
Re: Help with WindRiver pneumatics code
some further comments - we are getting 12 V to the Solenoid break-out - the LED is lit up.
|
|
#8
|
||||
|
||||
|
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 |
|
#9
|
|||
|
|||
|
Re: Help with WindRiver pneumatics code
we're trying to use a 24V Festo solenoid for some reason, which we are switching out today.
|
|
#10
|
|||
|
|||
|
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.
|
|
#11
|
|||
|
|||
|
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?
|
|
#12
|
|||||
|
|||||
|
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. |
|
#13
|
|||
|
|||
|
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. |
|
#14
|
|||||
|
|||||
|
Re: Help with WindRiver pneumatics code
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.
Last edited by Alan Anderson : 03-22-2011 at 02:57 PM. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|