Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Alternating Compressors (http://www.chiefdelphi.com/forums/showthread.php?t=138975)

mschwab013 06-11-2015 17:09

Alternating Compressors
 
This past week Team 291 was finishing up the off-season t-shirt cannon we had been working on. We quickly realized that we would need to add a second compressor to avoid overheating. We wanted to be able to alternate between the compressors in order to give each a break.

This is the code that I wrote to allow us to alternate between the 2 compressors. It's in C++ and being used with an old cRio. We thought this was a really neat idea so I figured I would share it here. As you might have guessed 'comp1' and 'comp2' are the compressors. 'di1' is the pressure switch. A button on the controller was added to allow for a manual override so we could run both at once if needed. We haven't had any issues yet but suggestions for improvements are always appreciated.

Code:

int toggle_comp=1;
bool comp_previous=0;
bool button1=0;

button1 = stick->GetRawButton(1);

if(di1->Get()==1 && comp_previous==0)
{
        comp1->Set(comp1->kOff);
        comp2->Set(comp2->kOff);
        toggle_comp++;
        comp_previous=1;
}
else if(di1->Get()==1 && comp_previous==1)
{
        comp1->Set(comp1->kOff);
        comp2->Set(comp2->kOff);
}
else if(di1->Get()==0 && comp_previous==1)
{
        comp_previous=0;
}

if(di1->Get()==0 && toggle_comp%2==0 && button1==0)
{
        comp1->Set(comp1->kOff);
        comp2->Set(comp2->kOn);
}
else if (di1->Get()==0 && toggle_comp%2!=0 && button1==0)
{
        comp1->Set(comp1->kOn);
        comp2->Set(comp2->kOff);
}
else if (di1->Get()==0 && button1==1)
{
        comp1->Set(comp1->kOn);
        comp2->Set(comp2->kOn);
}

Note: This is just the code pertaining to the compressor in teleop and not the entire program

cbale2000 06-11-2015 23:50

Re: Alternating Compressors
 
Why not just use a compressor that's rated for continuous duty instead?

IMO, the KoP/FIRSTChoice compressors are not a great solution for a T-shirt cannon anyways. I designed a T-Shirt cannon that used 2 Vlair 450c compressors running off of their own battery, and even that seemed like it would be under-powered.

mschwab013 07-11-2015 00:04

Re: Alternating Compressors
 
Quote:

Originally Posted by cbale2000 (Post 1503720)
Why not just use a compressor that's rated for continuous duty instead?

This is mostly just intended as an off-season project to get more students interested. It won't be seeing heavy use so we wanted to build it using only parts we already had. Thanks for the suggestion though! We might look into making it more heavy duty in the future.

Jon Stratis 07-11-2015 00:15

Re: Alternating Compressors
 
Quote:

Originally Posted by mschwab013 (Post 1503725)
This is mostly just intended as an off-season project to get more students interested. It won't be seeing heavy use so we wanted to build it using only parts we already had. Thanks for the suggestion though! We might look into making it more heavy duty in the future.

As a fun exercise for your students, have them do some calculations - how much air per shot is required, what is the anticipated shooting rate, and thus the required airflow to achieve that rate. Then have them do some research to see if there are better options out there, like one of the season-legal continuous duty compressors, or even a larger compressor that wouldn't be legal during the season. For an anticipated operating period, how much battery would be used, and is that a problem? If it is, how much air storage would you need to generate on a different battery before starting the event in order to keep the battery during the event functional?

There's a lot of room in these types of projects to dive into some of the math involved... Something that teams may do during the season with their robot, or they may just wing it, using their experience to get something "close enough" without bothering with all the math. But now's the time to teach them how to analyze the problem from multiple angles to find the best solution :)

MrForbes 07-11-2015 09:49

Re: Alternating Compressors
 
neat project!

of course just putting a small fan so it blows on the compressor would solve the problem....

Engineering is fun!

Ari423 07-11-2015 10:06

Re: Alternating Compressors
 
Quote:

Originally Posted by MrForbes (Post 1503743)
of course just putting a small fan so it blows on the compressor would solve the problem....

According to everything that I've read, a non-continuous duty compressor will produce less air over time, even if it is well cooled. They simply aren't made to be run for long periods of time. Maybe with sufficient cooling you can prolong that time to longer than 5 minutes.

Tangert 08-11-2015 21:36

Use an scba tank or a nitrogen tank hooked into a regulator that has an inlet pressure rating of 4k and an outlet rating of 150-400 psi. Can go a whole football game on 1 battery and 1 tank.

GeeTwo 09-11-2015 00:04

Re: Alternating Compressors
 
Quote:

Originally Posted by Tangert (Post 1504013)
Use an scba tank or a nitrogen tank hooked into a regulator that has an inlet pressure rating of 4k and an outlet rating of 150-400 psi. Can go a whole football game on 1 battery and 1 tank.

We've done at least two football games on a scuba tank, with a fresh battery for each game. The standard scuba regulator produces about 150 psi, and we used a stock FRC regulator to charge our cast iron accumulator tank to 50-60 psi. We then used 1"+ plumbing and a 3/4" solenoid valve (way beyond FRC legal in volume, though not pressure) to feed into our launcher. With 60 psi and 50 ms of "solenoid open" time, we have tossed t-shirts and foam mnii-footballs over our press box onto Ninth Street. To date, we have run 40-50psi during games, keeping a 50ms "valve open" time, to get most of our shirts and footballs to land somewhere in the stands..

BJT 09-11-2015 00:48

Re: Alternating Compressors
 
You have two compressors, just run them both at the same time. Would that not do the trick and be simple?
And fans, fans are good.

mschwab013 09-11-2015 11:47

Re: Alternating Compressors
 
Quote:

Originally Posted by Tangert (Post 1504013)
Use an scba tank or a nitrogen tank hooked into a regulator that has an inlet pressure rating of 4k and an outlet rating of 150-400 psi. Can go a whole football game on 1 battery and 1 tank.

We will probably do something like that next off-season.

Quote:

Originally Posted by BJT (Post 1504067)
You have two compressors, just run them both at the same time. Would that not do the trick and be simple?
And fans, fans are good.

We have the option to run them both, but they overheat pretty fast. So alternating helps keep the temperature down. Fans will also be added sometime this week.

Thanks for the suggestions everyone!

MrForbes 09-11-2015 15:12

Re: Alternating Compressors
 
Adding a little fan to one of those little compressors does amazing things...try it first....may be all you need.

mschwab013 09-11-2015 21:29

Re: Alternating Compressors
 
Quote:

Originally Posted by MrForbes (Post 1504141)
Adding a little fan to one of those little compressors does amazing things...try it first....may be all you need.

That did do amazing things. We added a fan to each compressor and they stay perfectly cool.


All times are GMT -5. The time now is 02:28.

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