Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   How to work with pneumatics (http://www.chiefdelphi.com/forums/showthread.php?t=86617)

Rangel(kf7fdb) 20-08-2010 19:04

How to work with pneumatics
 
Hey I'm starting to do pneumatics only I dont know how to start. How would you start to do something simple like turn the compressor on. We are using Windriver by the way. The compressor is connected to Digital sidecar relay 8 also.

Joe Ross 20-08-2010 19:14

Re: How to work with pneumatics
 
Have you looked at the compressor class?

Rangel(kf7fdb) 20-08-2010 19:20

Re: How to work with pneumatics
 
How do we use this compressor class?

Radical Pi 20-08-2010 22:50

Re: How to work with pneumatics
 
Code:

Compressor *compressor;

Contructor() {
...
compressor = new Compressor(PRESSURE_SWITCH_CHANNEL, RELAY_CHANNEL);
compressor->Start();
...
}

replace PRESSURE_SWITCH_CHANNEL and RELAY_CHANNEL of course

DonRotolo 22-08-2010 12:07

Re: How to work with pneumatics
 
The short version is that there are classes (named objects) in the software packages we have been given. You just plug in the specifics (such as 'channel 8 of sidecar 0') and it works. I'm not a programmer, so I can't explain how it works. Magic, maybe. But it's pretty easy.

Turning the compressor on an off is only the start, of course. You turn it on while the pressure switch is "closed" and then turn it off when the switch is "open". The only other major thing you need to do is 'turn on this solenoid valve' when 'this' (usually a joystick button press) happens. You usually toggle the valve on or off depending on what condition it had last.

davidthefat 22-08-2010 23:46

Re: How to work with pneumatics
 
What? I just made a solenoid object and literally just turned on or off the solenoid that was controlling the compressor, it worked great.

Alan Anderson 23-08-2010 02:06

Re: How to work with pneumatics
 
Quote:

Originally Posted by davidthefat (Post 972280)
What? I just made a solenoid object and literally just turned on or off the solenoid that was controlling the compressor, it worked great.

It "works", but it's not in accordance with the robot rules of the past two years. The compressor must be controlled based on the feedback from the pressure switch.

Rangel(kf7fdb) 31-08-2010 19:22

Re: How to work with pneumatics
 
Quote:

Originally Posted by Radical Pi (Post 972150)
Code:

Compressor *compressor;

Contructor() {
...
compressor = new Compressor(PRESSURE_SWITCH_CHANNEL, RELAY_CHANNEL);
compressor->Start();
...
}

replace PRESSURE_SWITCH_CHANNEL and RELAY_CHANNEL of course

How do we put this piece of code on our code. We just have the simple template.

Rangel(kf7fdb) 31-08-2010 20:19

Re: How to work with pneumatics
 
1 Attachment(s)
Never mind, got the compressor to start but now we need to get the compressor to stop. How do you make it stop at 60 psi?

Bot190 31-08-2010 22:17

Re: How to work with pneumatics
 
Quote:

Never mind, got the compressor to start but now we need to get the compressor to stop. How do you make it stop at 60 psi?
You can't do this with whats in the KOP. Your pneumatics system should have a pressure switch inline with it. The pressure switch from the programs point of view, returns 1 when the pressure is less than 90 then returns 0 when its greater than 115. If i remember correctly. What the compressor class does is takes the channel for the pressure switch and a channel for the relay for the compressor itself. Then it turns the compressor on when the pressure switch returns a 1 and shuts it off when the pressure switch returns 0.

To turn the compressor off when it reaches a different PSI, you either need a pressure switch that changes state at 60 PSI or you need a Pressure Transducer, which applies resistance depending on the pressure.

Radical Pi 31-08-2010 22:23

Re: How to work with pneumatics
 
Quote:

Originally Posted by Rangel(kf7fdb) (Post 972997)
Never mind, got the compressor to start but now we need to get the compressor to stop. How do you make it stop at 60 psi?

you have compressor.Start() in the OperatorControl loop. it should be in the initializer (where you have GetWatchdog().SetExpiiration(0.1);), so your code becomes
Code:

        RobotDemo(void):
                myRobot(3, 4),       
                myRobot2(2, 1),
                myRobot3(5, 6),
                stick(1),
                stick2(2),
                stick3(3),
                compressor(1, 8)
               
        {
                compressor.Start();
                GetWatchdog().SetExpiration(0.1);
        }

Assuming you have a pressure switch hooked up to GPIO port 1 your compressor should stop at 120 psi

Also, why do you have 2 different robotDrives running with the same inputs? You can list 4 jaguars in the initializer of a single robotDrive and it will output to two motors per side.


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

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