View Full Version : Arduino - RoboRIO Question
Qbot2640
15-03-2015, 09:45
We've created an Arduino based indicator that we want to use, which gets triggered by the relay signal that is sent to a Spike. (One action is activated when the motor is run in one direction, and a different action is activated when the motor is run the other direction. A third "neutral" action runs when the motor is not engaged.)
Before installing, we measured the voltage of the red and white PWM wire leads (with respect to the black) and found them to be very close to +5v (for each direction the motor is run, respectively).
Using the 5V supply from the Arduino itself to simulate the voltage from the PWM wire signals, the program worked perfectly off the robot.
When we put the indicator on the robot, it remained in the "neutral" third action no matter what we did with the motor. When we checked the voltage again (white and red from PWM WRT black), we found it to be now only approximately 1 volt.
So I guess my questions (finally) are (1) Why does the voltage read 5 Volts when not attached, and only 1 Volt when attached...and (2) Is this normal or have we done something wrong. Then (3) If this is normal, we can use an analog input...what minimum voltage should we expect at each signal pin, so we know what to use as our "trigger" value?
techhelpbb
15-03-2015, 10:19
Without a circuit diagram it sounds like you are overloading something.
How much current does your circuit input draw when it works correctly?
Qbot2640
15-03-2015, 10:29
Without a circuit diagram it sounds like you are overloading something.
How much current does your circuit input draw when it works correctly?
I haven't measured, but it is only a bunch of LED's and they should be independently powered by the Arduino, which we have plugged into a 12V supply from the new VRM.
Without a circuit diagram, I'll try to explain...eight groups of LED's are wired to the digital pins 6-13 - configured as outputs (anodes) and to ground (cathodes). Red PWM wire to pin 1 (configured as input) and White PWM wire to pin 2 (also input). Black PWM wire to ground.
Program runs only as if there is no voltage on either of the red or white PWM wires...however the robot works perfectly - motor goes forward and reverse exactly as controlled. When we checked the red and white wire voltage with everything connected, the voltage was much lower than the 5V we expected.
techhelpbb
15-03-2015, 10:47
motor goes forward and reverse exactly as controlled. When we checked the red and white wire voltage with everything connected, the voltage was much lower than the 5V we expected.
What motor are you describing?
Qbot2640
15-03-2015, 10:54
What motor are you describing?
We have split the PWM going to our lift motor's relay...the cable now simultaneously controls the Spike, and thus the lift motor...and is input for the indicator LED apparatus through the Arduino.
The motor is still responding, though the Arduino is not receiving a sufficient voltage to activate the indicator action.
techhelpbb
15-03-2015, 11:06
We have split the PWM going to our lift motor's relay...the cable now simultaneously controls the Spike, and thus the lift motor...and is input for the indicator LED apparatus through the Arduino.
The motor is still responding, though the Arduino is not receiving a sufficient voltage to activate the indicator action.
Try disconnecting the split and just driving the Arduino.
Make sure to check the voltages before you hook up just the Arduino.
billbo911
15-03-2015, 11:34
Without a circuit diagram, I can only make suggestions that are nothing more than a guess.
That said, the first thing I would suggest is making certain that you are also tying ground from the RoboRio to the ground on the Arduino.
The next step I would do would be to put 10k ohm pull down resistors on the inputs to the Arduino. That would make sure that you have a solid ground reference, and not have the inputs to the Arduino floating.
Qbot2640
15-03-2015, 11:43
Without a circuit diagram, I can only make suggestions that are nothing more than a guess.
That said, the first thing I would suggest is making certain that you are also tying ground from the RoboRio to the ground on the Arduino.
The next step I would do would be to put 10k ohm pull down resistors on the inputs to the Arduino. That would make sure that you have a solid ground reference, and not have the inputs to the Arduino floating.
We have the black (ground) wire from the Spike's PWM going to ground on the Arduino...is that sufficient for grounding the RoboRIO to the Arduino as suggested...and for the pulldown resistors, do I just wire the red and white each through a 10K to ground? I did have it that way on the "off-board" but eliminated the resistors when I went to the robot.
billbo911
15-03-2015, 12:34
We have the black (ground) wire from the Spike's PWM going to ground on the Arduino...is that sufficient for grounding the RoboRIO to the Arduino as suggested...and for the pulldown resistors, do I just wire the red and white each through a 10K to ground? I did have it that way on the "off-board" but eliminated the resistors when I went to the robot.
Yes and yes. Additionally, don't define the inputs on the Arduino as "Input Pullup". That would negate the action of the pull downs.
Alan Anderson
15-03-2015, 13:41
[Disclaimer: I cannot find a schematic to the Spike internals. What I say here is from many-years-old memory and not guaranteed.]
The Spike inputs are not logic level signals. They actually provide power to an optical isolator. The current is supposed to be limited to 40 ma; I do not know what voltage that ends up corresponding to.
The roboRIO Relay outputs have a 40k resistor to ground, so there is no need for a pulldown on the Arduino inputs.
billbo911
15-03-2015, 13:57
....
The roboRIO Relay outputs have a 40k resistor to ground, so there is no need for a pulldown on the Arduino inputs.
True. I was not aware of the internal pull-down resistors.
I would probably connect the Arduino to a digital output from the robotRio and just have the program control the digital outputs wherever its controlling the spike.
techhelpbb
17-03-2015, 18:30
Much like your I/O issue you've left this topic in an indeterminate state :)
So did you figure the issue out?
Qbot2640
17-03-2015, 22:35
Much like your I/O issue you've left this topic in an indeterminate state :)
So did you figure the issue out?
Actually, no. I though I had something with the resistor to ground suggestion, then Alan pointed out that there is already a large resistance in the relay outputs to ground. SuperBK's suggestion is a good one, but programming is not our strength this season, so I don't want to ask the programmers to add any complexity at all. I wrote an Arduino program that uses the analog inputs, and a while loop for greater than ... I'll try that. It should be able to detect the very low voltage we are reading. Otherwise, we'll just run a decorative program. Thanks, though!
(SuperBK is a recent acquaintance...and will be at the NC Regional with us on Thursday...perhaps I'll monopolize some more of his time!)
The Doctor
18-03-2015, 10:21
AFAIK the red pwm wire is 5v and not a data line.
Qbot2640
18-03-2015, 10:27
AFAIK the red pwm wire is 5v and not a data line.
The relay outputs are "FWD" and "REV" rather than "S" and "+5V" for White and Red Respectively. As such, the White and the Red each carry a voltage with respect to ground for their respective directions. I counted on that voltage remaining close enough to 5V to operate the Arduino's digital input (I believe 3V is the minimum necessary).
feverittm
18-03-2015, 10:34
Not on the relay outputs! On the relays both the red and white wires are outputs and drive +5V to the spike.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.