Go to Post I predict the champion drive teams at each event of the 2011 season will consist of vertebrates. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Pneumatics
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 24-02-2004, 17:57
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: pneumatics and joysticks

Quote:
Originally Posted by Jared Stofflett
Here is my question. We have our robot set up to use one joystick driving, so the motors are wired to pwm13 and pwm15 My question is how would I wire and program a pair of pneumatics cylinders so that if the joystick is in the forward position both fire, if the joystick is in the left position one fires and another doesn't, and so on. My problem is I understand how to make motors move but don't understand how to make the cylinders fire based on joystick input. Also I don't know where I'd have to remap the joystick and where to put the code for the pneumatics. Appreciate any info on this.
Code:
if (p3_y > 132) {
    relay1_fwd = 1;
    relay1_rev = 0;
    relay2_fwd = 1;
    relay2_rev = 0;
}
if (p3_x > 132) { 
    relay1_fwd = 1;
    relay1_rev = 0;
}
and so on. (And without a little more detail on your "and so on", I can't give you any more detail on mine. )




[edit]
Aww, what the heck. I'll give you a few more details for free.

1) This code could be added to Default_Routine() in user_routines.c. You would probably also want to remove any other code in Default_Routine() that has anything to do with these joystick axes and relays.

2) I don't know whether you are planning on ever having to retract the cylinders. You said you wanted to "fire" (extend?) two cylinders when the joystick is forward. If, for instance, you want to retract the same two cylinders when the joystick is pulled backwards, you will also need something like:
Code:
if (p3_y < 122) {
    relay1_fwd = 0;
    relay1_rev = 1;
    relay2_fwd = 0;
    relay2_rev = 1;
}
3) Notice that I'm testing for < 122 and > 132. This gives you a dead band in the middle, so that you don't get the cylinders firing spuriously (and/or furiously ) because the joystick is not perfectly centered.

4) The last time I checked (last year with the old OIs) the joystick X axis increases to the left, and decreases to the right. That is why I tested for p3_x > 132, and not less than 122.

[/edit]
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 24-02-2004 at 18:24.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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