View Full Version : Compressor
NegaNexus
15-01-2013, 18:14
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: #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
What do you expect to happen? What is happening instead?
NegaNexus
15-01-2013, 21:39
It does absolutely nothing. It is supposed to start, and then we'll do further testing.
Alan Anderson
15-01-2013, 22:20
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
It does absolutely nothing. It is supposed to start, and then we'll do further testing.
NegaNexus
16-01-2013, 01:32
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
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
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 :)
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/Project2012/blob/master/Robot2012.cpp
NegaNexus
16-01-2013, 18:31
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
We fixed it. Thanks for trying though.
Alan Anderson
19-01-2013, 09:00
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
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.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.