View Full Version : Spike relay code not working
wywern209
27-01-2010, 23:33
My team has gotten code to download to the robot however the code that we used to utilize the spike relay is not doing anything. We are using windriver if that helps. Thanks in advance for any replies.
Alan Anderson
28-01-2010, 01:21
Without seeing the code, and without knowing what you want it to do, we can't tell you whether it is correct.
But before we start down the path of troubleshooting software, there is a question which must be asked:
Are you clicking the button in the Driver Station operations screen to enable the robot when you try to run the code?
lon.bushweiler
28-01-2010, 11:06
Another thought is that the PWM connector on the Spike and speed controllers are somewhat finicky. They will look like they are connect but are actually not. Try re-seating the cable a couple times to see if that changes anything.
Mark McLeod
28-01-2010, 12:19
I'm with Alan on verifying the simple things first.
Develop a checklist for yourself that lists all the available statuses you should be checking that indicate proper and correct operation. Know what the blinking and non-blinking lights mean. These are just a few:
Driver Station
Enable lit up on Operation tab
Status tab status lights
Error message window
Digital Sidecar
Robot Status LED
Power LEDS
Relay status LEDs
Spike Relay
Power orange, red/green - forward/backward
cRIO
Solenoid Module status LEDs
There are others of course, e.g., Power Distribution Panel breaker status LEDS, power status LEDS on most of the electronics, etc.
Telling us what some of these demonstrate to you helps us help you.
Another thought is that the PWM connector on the Spike and speed controllers are somewhat finicky. They will look like they are connect but are actually not. Try re-seating the cable a couple times to see if that changes anything.
A good thought. This problem doesn't affect the Relay status lights on the Digital Sidecar, so checking those are the best indicator or whether your code is working as it should. If the Digital sidecar Relay LEDs are turning on and of, then it'd be downstream of that, meaning the PWM wiring from the Sidecar to the Spike.
Bryan Herbst
28-01-2010, 13:18
If you have gone through the above checklist(s), then here is some important information to provide-
How do you know the relay is not functioning properly? If there is simply no mechanical action happening, then it could just as well be an electrical problem as a programming problem.
Check the lights on the relay itself- Are they changing? What color are they?
The sidecar and dashboard also have indicator lights. Check those.
Also be sure to check the relay's fuse, just in case.
Finally, it is important to list all of the steps you have already taken, and what their result was.
If you determine it to be a code problem, then you should provide snippets of the relevant code. We cannot help troubleshoot code if we don't know what is there.
wywern209
28-01-2010, 20:06
bool trigger= stick.GetRawButton(3);
float potentiometerreading= potentiometer.GetAngle();
if(trigger)
{
fan.Set(Relay::kForward);
}
if (potentiometerreading>0)
{
fan.Set(Relay::kOn);
}
----------
Here is the code we have right now. Our mentor is wondering if we should have used digital output instead of the relay.
Bryan Herbst
29-01-2010, 15:46
Once again, what is telling you that the spike is not working?
When you say it isn't doing anything, do you mean that there is no light, or that the light is not changing color?
If there is no light, then it is a wiring problem. The relay is not connect to the PDB properly, the relay is not set properly (or is blown), or the PWM cable is not properly attached.
If there is a light and it is not changing color, then you know that it is a coding problem.
As for digital output- no. If the fan is attached to a spike, then the PWM cable should go to a relay output on the side car, and you should use the relay code.
Paul 2912
30-01-2010, 12:59
Did you get your issues resolved? We are having the same problem with labview not able to get the relay outputs working on the side car!
Alan Anderson
30-01-2010, 21:13
It is very frustrating not to be able to offer constructive help to teams having problems when they don't give enough detail about their problems. When people with experience in the domain ask questions, please answer them if you want to help them help you.
If you are having similar problems, answers to the same questions will get you much better assistance.
1jbinder
05-02-2010, 22:04
We are having similar problems. The spike is orange, but when i create a relay object and I try to set it to go forward, nothing happens. It seems like the spike will not turn on. The one weird thing i noticed is that the light on the digital sidecar that usually flashes when disabled, is not flashing. We tried switching digital modules and digital sidecars, but neither of these fixed the problem. The spike is plugged into relay port 1.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.