Go to Post If you pay attention to every nut job on ChiefDelphi, you'll never reach a decision. - JesseK [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 29-01-2015, 17:39
hyprvx's Avatar
hyprvx hyprvx is offline
Registered User
AKA: Devon
FRC #2151 (Monty Pythons)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Forest Park
Posts: 22
hyprvx is an unknown quantity at this point
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
__________________
My userbars were eaten by Cthulhu.


FRC team 2151, the Monty Pythons!
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2015, 10:39
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,725
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Relays only going backwards?

Quote:
Originally Posted by hyprvx View Post
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?
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2015, 11:06
mmaunu's Avatar
mmaunu mmaunu is offline
Registered User
FRC #2485 (W.A.R. Lords)
Team Role: Mentor
 
Join Date: Mar 2013
Rookie Year: 2010
Location: San Diego, CA
Posts: 89
mmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the roughmmaunu is a jewel in the rough
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?
__________________
2014 Las Vegas (Winners with 987, 2478; Excellence in Engineering)
2014 San Diego (Finalists with 987, 3250; Quality Award)
2013 Inland Empire (Winners with 1538, 968; Excellence in Engineering Award)
2013 San Diego (Finalists with 2984, 4322; Creativity Award)
2012 Las Vegas (Finalists with 2034, 3187; Quality Award)
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2015, 20:50
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Relays only going backwards?

Does the LED on the relay change when you command the relay in reverse?
Reply With Quote
  #5   Spotlight this post!  
Unread 31-01-2015, 10:04
hyprvx's Avatar
hyprvx hyprvx is offline
Registered User
AKA: Devon
FRC #2151 (Monty Pythons)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Forest Park
Posts: 22
hyprvx is an unknown quantity at this point
Re: Relays only going backwards?

Quote:
Originally Posted by notmattlythgoe View Post
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 View Post
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 View Post
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.
__________________
My userbars were eaten by Cthulhu.


FRC team 2151, the Monty Pythons!
Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2015, 11:51
hyprvx's Avatar
hyprvx hyprvx is offline
Registered User
AKA: Devon
FRC #2151 (Monty Pythons)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Forest Park
Posts: 22
hyprvx is an unknown quantity at this point
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.
__________________
My userbars were eaten by Cthulhu.


FRC team 2151, the Monty Pythons!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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