Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Compressor (http://www.chiefdelphi.com/forums/showthread.php?t=111319)

NegaNexus 15-01-2013 18:14

Compressor
 
Hello, I am from the TeraViks #3145. As of right now, we're stuck. We are stuck on programming the compressor to work. Please help us with any information you have on this predicament. Thanks! Sample:
Code:

#include "WPILib.h"


class RobotDemo : public SimpleRobot {
        Compressor *compressorPointer;

        public:
                RobotDemo() {
                        compressorPointer = new Compressor(4, 2);
                        compressorPointer->Start();
                }

                ~RobotDemo() {
                        delete compressorPointer;
                        };
};


Alan Anderson 15-01-2013 21:25

Re: Compressor
 
What do you expect to happen? What is happening instead?

NegaNexus 15-01-2013 21:39

Re: Compressor
 
It does absolutely nothing. It is supposed to start, and then we'll do further testing.

Alan Anderson 15-01-2013 22:20

Re: Compressor
 
How exactly do you have the compressor and pressure switch wired? Be as detailed as you can.

Does anything work on the robot -- any motors or relays?

NegaNexus 15-01-2013 22:40

Re: Compressor
 
It does absolutely nothing. It is supposed to start, and then we'll do further testing.

NegaNexus 16-01-2013 01:32

Re: Compressor
 
I have no idea why there are two of the same posts, but anyway. They are plugged it to relay 3, digital I/O 4. Everything we tested so far works besides the solenoid and compressor.

Sent from my Nexus 7

Alan Anderson 16-01-2013 07:42

Re: Compressor
 
That's not nearly enough detail for me to give troubleshooting advice. Which individual pins of the Digital Sidecar are connected, and to what? The compressor has two power wires; where do they go?

Pictures would help.

DjScribbles 16-01-2013 10:42

Re: Compressor
 
Your sample code states the compressor is digital i/o 4, and relay 2, you say you are using relay 3; is that your issue?

Try calling compressor->Start() in your teleop/autonomous loop.

The code you presented is fine otherwise, though I would opt to directly instance compressor, rather than allocating it dynamically, but it's a point of preference. I also prefer to derive from IterativeRobot instead of SimpleRobot :)

Code:

class Robot2012 : public IterativeRobot
{
Compressor compressor;
public:

Robot2012(void):compressor(DIGITAL_CHANNEL_1_INPUT_COMPRESSOR_SWITCH, RELAY_CHANNEL_1_COMPRESSOR_RELAY)
{
}

void DisabledInit(void)
{
    compressor.Stop();
}
void AutonomousInit(void)
{
    compressor.Start();
}
void TeleopInit(void)
{
    compressor.Start();
}


Here's a link to my 2012 code: https://github.com/TeamExcel/Project.../Robot2012.cpp

NegaNexus 16-01-2013 18:31

Re: Compressor
 
I didn't post the updated code, which has (4, 3) now. Sorry about that. It still won't work either way. To Mr. Anderson, I'll get a picture to you tomorrow.

Thanks,
Thys

NegaNexus 19-01-2013 00:49

Re: Compressor
 
We fixed it. Thanks for trying though.

Alan Anderson 19-01-2013 09:00

Re: Compressor
 
Quote:

Originally Posted by NegaNexus (Post 1218367)
We fixed it. Thanks for trying though.

Would you mind telling us what the problem was and what you did to make it work? Others might have similar problems, and your solution might help them.

TeraViks 20-01-2013 14:43

Re: Compressor
 
On behalf of NegaNexus (one of my programmers), thank you to all who helped. This was one of those instances where we had a few different issues that makes troubleshooting extremely difficult and frustrating.

Here's what we found was the cause of our issues:

1. We had a flaky network cable!
2. We had a flaky Windriver install (or some setting was changed that shouldn't have been)

Once we got in to a methodical test & record results process, we were able to diagnose the bad network cable. This then led to changing to a different computer with WR and all systems worked as they should.


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

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