|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Spike relay only works in reverse
We have a window motor connected to a spike relay and our Labview code is able to manipulate it in both directions but when we flash the cRio and load our Java code, the relay only runs in reverse.
We have tried multiple scenarios trying to track down the issue and these have included: changing the constructor (new relay(1); new relay(1,1); new relay(1,1,kBoth) , we have changed the code and replaced the kReverse, which works, to kForward. We have even verified that kForward has a value of 2 by outputing the value to the dashboard.When we watch the relay, reverse does turn the LED red but forward never changes to green. Team 3224 Lion Hit Squad |
|
#2
|
||||
|
||||
|
Re: Spike relay only works in reverse
What do the relay lights on the DSC do?
|
|
#3
|
|||||
|
|||||
|
Re: Spike relay only works in reverse
It is possible to have the relay only respond in one direction if the PWM cable is defective. The Spike is controlled by the two lines, not by PWM. It is only using the same cables for this connection. The DSC will have two LEDs for each relay output. If the indicators are correct, then replace the wire.
|
|
#4
|
|||
|
|||
|
Re: Spike relay only works in reverse
Quote:
Have you tried swapping out the relay and the results are the same? Are you running the test with the motor connected or disconnected? I would remove the motor from the relay and just verify voltage output from the relay terminals for now using a volt meter. Regards, Kevin |
|
#5
|
|||
|
|||
|
Re: Spike relay only works in reverse
We usually instantiate our Spikes like so:
Code:
Relay spike = new Relay(1); Code:
spike.set(Relay.Value.kOff); Last edited by AlexBrinister : 16-03-2014 at 09:29. Reason: Messed up Direction and Value |
|
#6
|
|||
|
|||
|
Re: Spike relay only works in reverse
It looks to me (based on the javadoc) that the default constructor for the Relay objects defaults to allowing the Relay object to operate in both directions.
Hence your constuctor: Code:
Relay spike = new Relay(1); Code:
Relay spike = new Relay(1, Relay.Direction.kBoth); Code:
public void autonomous() {
// SimpleRobot autonomous test code that transitions the relay through
// all 3 states (2 seconds forward, 2 seconds reverse, then off).
// +12 volts out (think this displays the green LED on DSC)
spike.set(Relay.Value.kForward);
Timer.delay(2.0);
// -12 volts out (think this displays the red LED on DSC)
spike.set(Relay.Value.kReverse);
Timer.delay(2.0);
// 0 volts out
spike.set(Relay.Value.kOff);
}
|
|
#7
|
|||
|
|||
|
Re: Spike relay only works in reverse
We have some relays that work fine, but the LEDs don't work well as indicators. I'd use a meter to see if there's actually output rather than going solely with the indicator.
Also, if the direction of the relay is set to kBoth, you can have a 4th state using Relay.Value.kOn. kOn puts 12v down both M+ and M- at the same time. We use it to control two separate items with the one relay... See the IFI Spike user's guide: http://content.vexrobotics.com/docs/...uide-sep05.pdf |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|