![]() |
Spike Relay code failing
We are using a spike relay to control a spinbrush in the front of the robot to sweep in balls. I created a new spike relay object and used the left trigger to get it to move. However, every time I hit the trigger, the ENTIRE robot jerks forward and then becomes unresponsive until I disable and renable teleop. And when i say jerk froward, I mean that the CIM motos, which are connected to our 4 jaguars, move and the spin brush moves too, albeit for a short period of time. Is there some issue in the code that could cause this to happen?
Code:
package edu.wpi.first.wpilibj.templates; |
Re: Spike Relay code failing
Can you drive the robot around normally until you hit the trigger?
|
Re: Spike Relay code failing
Could you try this: http://www.usfirst.org/sites/default...structions.pdf
We had very similar problems with out ribbon cable and ended up just using a previous year's cable. |
Re: Spike Relay code failing
The robot does drive somewhat normally until we hit the trigger, however we have noticed that if we go full forward on the left side and full throttle reverse on the right side, the robot locks up and we need to disable and renable teleop for it to work again. Both sides forward, both sides backward, one side forward with the other side at 0 and Left reverse and right forward are fine. It's only going forward on the right side and reverse on the left that makes it lock up.
Also, we did change our ribbon cable. We are using this old printer cable. |
Re: Spike Relay code failing
Hmm, doesn't sound like a programming issue to me, though I could be wrong. However, nothing comes to mind as to what could be the issue. I'll think it over today and hopefully come up with something!
|
Re: Spike Relay code failing
For relays, we use the following to make our spikes operate.
Quote:
Here is a link to the Javadoc |
Re: Spike Relay code failing
Well we managed to get past the joystick issues during driving through some limiting code. We limited the joystick y values to .6 only when driving the sides in opposite directions to keep the robot from locking up. I am not sure why but suppling any throttle value higher than around .6 to the jaguars when going opposite directions causes it to shut down. Im thinking that this may be a voltage issue, because if we use a battery that is only about 25% charged we can limit it at .75 without any problems. But the relays are still not working.
On a side note, to wire the relays do we need to modify a PWM cable, because only the B(closest to fuse) is labeled. The ground could be the middle pin which would require a modification of the cable. |
Re: Spike Relay code failing
Just today, I wired a PWM from Relay to a Spike without problems, if that counts for anything.
|
Re: Spike Relay code failing
so for clarification when coding something like:
Relay spike = new Relay(5); the spike relay would connect through PWM output 5 correct? |
Re: Spike Relay code failing
It would actually connect to Relay output 5. PWM and Relay outputs use the same cable but different types of signals.
|
Re: Spike Relay code failing
Could someone please try running this code on their robot? All it does is control a relay and drive the bot. We are getting weird problems with this:
Code:
/*----------------------------------------------------------------------------*/Also, when we try and drive left forward and back reverse without limiting the values to around .6 it stops and becomes unresponsive. driving both wheels forwards or reverse works fine, as long as they are going the same direction, and driving left reverse and right forward doesn't give us any problem. If someone else could run this it would show us the the programming isnt the problem. Thanks in advance for your help. |
Re: Spike Relay code failing
I don't have a robot to load your code on right now......but it looks fine.
This sounds like an electrical/wiring issue. At first thought, it seems like it might be drawing too much current and lowering the voltage of the battery to the point where the cRio is losing it's minimum voltage to operate. There's of course of ton of things you could do to try and troubleshoot this. 1. Try changing your code to run only two motors instead of four. Use one on the left and one on the right like tank drive. Re-create the situation that causes it to stop and see if it persists. 2. Instead of changing the code, try unhooking the PWM cables to one jaguar at a time. Create the same situation that causes it to stop for each unhooked PWM cable. 3. Enable the relay code ( code it so a joystick button press sets it to kForward, so its off when it first starts until you press the button) , plug in all jaguars, but disconnect the spike from the digital sidecar. Run the robot and press the button you assigned in the code to turn on the spike relay (pretending its plugged in, even though it isn't). If it still jerks and dies, then it's code related. If not, you've got a wiring issue. I'm not too sure that the relay problem is directly related to the motor issue. Let me know if any of that gets you some results. I'll think of some more things to do for troubleshooting. If you could, PM me a picture of your control system including all components. -Sean |
Re: Spike Relay code failing
We'll be trying some of those suggestions you've provided. Thanks! :)
|
Re: Spike Relay code failing
We had similar issue and after 3 hours of trying to fix it, we figured someone forgot to power the Digital Sidecar.
Before powering it, it could only handle 2 CIM motors, anything more would just make everything not work. And even Relay caused it to jerk and become unresponsive. (Same issue as you are having.) After powering it, all the lights turned on, including the team light, and everything worked fine. I would double check the wiring for powering the Digital Sidecar to 20 amps breaker. And also see if your team light is working. Hope that helps. |
Re: Spike Relay code failing
So we did check the sidecar. It is being powered properly. Can someone please run this code on their robot? Just to confirm that it is not a programming issue.
We did try binding the relay to a trigger. Whenever we hit the trigger the same thing happens. In other words, activating the relay causes it to jerk. Also, we tried to disconnect the relay but still run it. We got the same issue. We did try running the relay but commenting out the robot drive object and related methods. This didnt get the relay to run but the cim motors didnt jerk at least. Thank You. |
| All times are GMT -5. The time now is 12:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi