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.
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?
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.
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:
[ul]
[li]Driver Station[LIST][/li][li]Enable lit up on Operation tab[/li][li]Status tab status lights[/li][li]Error message window[/ul][/li][li]Digital Sidecar[/li][ul]
[li]Robot Status LED[/li][li]Power LEDS[/li][li]Relay status LEDs[/ul][/li][li]Spike Relay[/li][ul]
[li]Power orange, red/green - forward/backward[/ul][/li][li]cRIO[/li][ul]
[li]Solenoid Module status LEDs[/ul][/li][/LIST]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.
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.
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.
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.
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.
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!
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.
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.