I’ve been working with some folks to adapt our old robots to run with an Arduino. We’ve got all the circuits we need up and running for our old Breakaway robot and that finally is going well.
The problem is, most of the interfacing resembles a rat’s nest /wire maze / nightmare on a couple of plug in breadboards. Works ok, but heaven help us if it takes a good hit.
I’d like like to be able to come up with an interface, whether it’s a DB37 pin breakout interface board, a homemade soldered prototype board, or a custom made shield for the Arduino.
Ideally, you unplug the DB37 from the cRIO, plug it into the interface, code the appropriate Arduino software and go.
I’ve looked at the digital sidecar schematic and MY impression, is, if I pull the right lines out, I can get them attached to the Arduino. There does not seem to be anything magical, and in fact using the DSC’s power capability is a plus.
Ah, but I’ve messed around with enough stuff to realize I don’t always know what’s going on, or, things are never quite what they seem.
Can anyone confirm I can accomplish what I want to do, in other words through some mechanism, couple the DSC directly to the Arduino?
I can’t confirm it for sure, but I’m thinking along the same lines as you. Looking at the pinout for the DB37, it should be as simple as connecting the right pins on the arduino to the DB37 cable. I’d like to see how you do with this.
It is certainly possible. All of the GPIO lines are simply pulled high within the DSC (the same as on board the Arduino) and the PWM lines are buffered. Basically, you can ignore all that and pretend that they are all direct connections. The relay outputs are controlled by a serial communication line, if you want to use those, you will have to figure out the serial protocol.
It is totally possible. I think it could be an excellent project for a group of students, because it is readily divided up into separate pieces that allow for quick “first-success”.
First, tie all the ground lines to your arduino. Pull 5V from the DSC to power the arduino - there isn’t a line for this on the 37pin connector, so pull it from one of the spare 5V pins (there are tons of them).
I would not recommend having the arduino connected to a computer and the robot at the same time. Arduinos aren’t well protected, and it is easy for a student to accidentally dump 12V across something that doesn’t want it.
Next, enable /Output_EN by pulling it low with a pin on the arduino. This enables/disables all of the pins that make things move.
Then try sending some PWM signals. There are lots of threads on this board about the times for these. Quick summary - 1.5 ms for stop. Jaguars are .66ms for full reverse, 2.33ms for full forward. Servos and Victors are 1ms and 2ms. Off period is pretty forgiving.
Then try using specific sensors with the GPIO. This will be different per sensor.
Save the shift registers for last. These control the relay outputs and some other (largely useless for your purposes) pins.
I wouldn’t bother with routing I2C through the DSC. Just do it raw through GPIO.
Perfect! This is where I was hoping to go. I had been running the Arduino off the Power Distribution Board (PDB) line that went to our DSC but you’re right, I can pull it off the DSC when I connect it back up.
We actually have been thinking of making it a fall robotics project for our students. I just wanted to make sure it’s possible, and that I understood enough about it to actually mentor the project.
I think the PWM situation is in hand. I’ve found that you can directly use the PWM outputs from the Arduino to the jags and it works fine (thanks for those of you who provided suggestions for that work!!!). And the GPIO lines can also directly activate spike relay’s. The only problem I’ve had so far is having to run the GPIO output to a 2222 transistor to run our 12V pneumatic valves or a relay to run the 24V ones.
I did not implement any sensors (we were just using the old Breakaway robot for driver training), and this is another big step for me.
Does anyone know if the digital side car can be controlled by an arduino through the I2C port on the sidecar?
If so, I am thinking that this might make for a nice little project to create a test system to plug into the I2C port for manipulating the items connected to the sidecar when the cRio is not connected (like during the build season or doing sysem checks in the pits…)