Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Relays only going backwards? (http://www.chiefdelphi.com/forums/showthread.php?t=133666)

hyprvx 29-01-2015 17:39

Relays only going backwards?
 
So we have one relay set on relay output 0, configured in both directions. We have boolean variables true if button 5 or 6 is held, respectively, and two while loops if those variables are true. In those loops, we have the relays set to trigger forwards or backwards, and when the code breaks out of those two loops, set back to off. The loop for backwards works perfectly; when I hold button 5, the relay triggers to go backwards. But button 6, when held, does nothing. We have stepped through the code with the debugger, and it's supposed to be setting the relay to forwards, but it does nothing. Help?

Our code is at https://github.com/caffeinatedDrummer/2151-Code

notmattlythgoe 30-01-2015 10:39

Re: Relays only going backwards?
 
Quote:

Originally Posted by hyprvx (Post 1435790)
So we have one relay set on relay output 0, configured in both directions. We have boolean variables true if button 5 or 6 is held, respectively, and two while loops if those variables are true. In those loops, we have the relays set to trigger forwards or backwards, and when the code breaks out of those two loops, set back to off. The loop for backwards works perfectly; when I hold button 5, the relay triggers to go backwards. But button 6, when held, does nothing. We have stepped through the code with the debugger, and it's supposed to be setting the relay to forwards, but it does nothing. Help?

Our code is at https://github.com/caffeinatedDrummer/2151-Code

When you step through the code with the debugger does it attempt to execute the line that sets the relay to forward?

mmaunu 30-01-2015 11:06

Re: Relays only going backwards?
 
Everything looks fine in the code, but...

Have you verified that you are correctly detecting button 6? The debugger shows that you are in the correct loop when button 6 is held down?

Can you tell us what the relay is controlling and show a picture of the wiring?

Joe Ross 30-01-2015 20:50

Re: Relays only going backwards?
 
Does the LED on the relay change when you command the relay in reverse?

hyprvx 31-01-2015 10:04

Re: Relays only going backwards?
 
Quote:

Originally Posted by notmattlythgoe (Post 1436062)
When you step through the code with the debugger does it attempt to execute the line that sets the relay to forward?

Yes, we see it's executing relayArms.set(Relay.Value.kForward); but no light change occurs.

Quote:

Originally Posted by mmaunu (Post 1436069)
Have you verified that you are correctly detecting button 6? The debugger shows that you are in the correct loop when button 6 is held down?

We are detecting button 6, and the second part just answered above.

Quote:

Originally Posted by Joe Ross (Post 1436374)
Does the LED on the relay change when you command the relay in reverse?

Yes, the relay LED changes to indicate reverse, and outputs the -12v, but does nothing on forward.

The relay is to control the motor for part of our arms mechanism.


This is a photo of our electronics board. The spike I am pointing to is the one we wish to control. The spike on the right does not work properly and will be removed soon.

hyprvx 31-01-2015 11:51

Re: Relays only going backwards?
 
I would like to update to say we have solved the problem. Our connections to the RoboRIO from the Spike were in backwards, enabling us to go backwards, but not forwards. Correcting the PWM connection to the RoboRIO has fixed the problem. I haven't yet seen any replies, so if anyone has suggested such a fix, thank you for noticing the problem before we did.


All times are GMT -5. The time now is 11:02.

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