I am not sure if this is entirely possible but i was wondering if it possible to create a physical switch on your robot to toggle between autonomous programs.
Since the robot responds to on board sensors, it sounds very possible.
I don’t see anything saying you can’t. It’s been done before, admittedly with the IFI system. (I don’t know of any with the cRIO yet.)
Our team did just this in 2009. We had a physical switch on our robot that was used depending on the way we were positioned on the field. It had 2 settings, one being for the left, and one for the right sides of the field.
So to answer your question, yes, it is possible, and very helpful in some situations.
Yes it is possible, 375 used the same system last year. What I’m wondering though, is if it is possible to accomplish the same goal using this year’s driver’s station. It seems as if you can toggle the digital inputs on the robot from the DS.
It will be possible, the robot should be able to read the states of any switches on the classmate PC break out (FirstTouch I/O Module, CY8CKIT-003).
Just what we wanted to hear. I am assuming you could have 3 different settings on a given switch. Could you fill us in on how you were able to make the switch?
You would wire the switch into the digital ports on the side of your onboard control board (cant think of the right word for the life of me).
If you want to use a toggle switch with two positions, you would connect the standard toggle switch between the two outer wire (GND, black and SIG, white or yellow) on a standard PWM cable and connect it to the Digital IO section on the Digital Sidecar. If the input is read as HIGH or 1, then the switch is off. IF the input is read as LOW or 0, the switch is on. If you need more positions, you could either add more switches to more digital inputs OR:
Wire several resistors with different values paralell to each other and fed by the +5 (center, red) wire on a PWM cable. Each would be connected to a different position on a multi-position rotary switch and the output of the switch would be fed to the SIG (white) wire on the PWM cable, which would be connected to a analog input on the analog breakout board of the cRio.
If you want to set an analog value, such as a wait delay, you could wire a pot with the outer wires to +5 and GND and the wiper to SIG and connect that to an analog input.
We have done all three of these, no problems. One thing to watch for is if you get a signal from the Driver Station during Auton, it might just send 0’s for the joysticks and dig. io’s when in auto so you can’t drive in auton. In that case, you would have to put it on the robot.
In 2009 we used two rotoray switches.
Switch one was a three position, to note our starting point on the field, and switch 2 was a 10 place selector to tell the robot what path to drive and each was adjusted as needed based on the input from switch 1.
They could be set when we placed the robot on the field.
Last year, I was able to do this with ours with a few switches connected to the I/O of the Digi. Sidecar. It was somewhat simple, just setting up the programming for it was long. Besides that is works like a charm I think we had 8 possible auto. we only used 4 or 6 max.
It’s actually much more convinient to do it in software.
We used one of the Joystick buttons to step through auto mode options.
They only worked when the robot was disabled in auto mode.
It saved the auto mode number in a file on the cRIO, so it remembered it next time it powerd up.
It also displayed the name of the program on the LCD display, so it will still work with the new DS’s.
The beauty of this method is that if you forget to set the mode when you position the robot, you can still change it up until the time you have to step away from the driver station.
I wrote a white paper last year…
my thing with it was that we didn’t know you could program the DS at the time, I didn’t until comp. so it ended up being hardwired. Not to mention could you program the DS with LabVIEW? But besides the point that is. Still Auto. switches are possible
In addition to all of the approaches already listed, the new DS also supports virtual I/O. If you are running the DS without an I/O board attached, the Compatible/Simple I/O page actually lets you set the values of the analog and digitals using the mouse. The values are saved with the DS until you change them again or connect the I/O HW, and they are latched during auto-enabled. Hopefully this means you can have inputs to the autonomous without necessarily needing a soldering iron.
Be sure to update the DS SW before playing with this too much as it changed between the laptop version and the update version.
Greg McKaskle
In 09 we had 2 SPST submini slide switches wired to the DSC with 2 PWM’s and had 4 different autonomous programs (2 up, 2 down, left up right down, right up left down) accordingly to where we were placed in the field. So its very possible
See you in Arizona
Good luck teams!
We have been using a program select switch at the DS for many years. Using a modified Radio Shack rotary switch and an analog input we can select one of 11 different program settings. A search of this site will turn up some interesting past discussions.
Last year we used three SPST on the DS (mounted on a piece of polycarb) to set autonomous modes by treating each one as a binary bit, giving us 8 possible auto modes. This system is simple to use and remember, can be changed right up until you step back, and can easily be expanded by adding another switch. I’m not sure how the implementation would work with the new driver station system, but we have also used the same switch setup on the robot ('08 I think) when we couldn’t get a signal to pass from the driver station to the robot during auto.
Yup, selectable autonomous is doable from both the DS and Robot end of the equation, though admittedly, I feel its easier and less prone to muck ups from the Robot end.
Its been being done by lots of teams for many years.
My team specifically has been using a device called a thumbpot, i think. It is a 2 digit selector with + and - keys for each digit, and reports an analog voltage back to the cRIO. Some fancy code to turn that back into the number shown on it, and away you go.
I know it has been answered, bu yes. You can indeed do this.
We had a set of several switches on our robot. Basically it was like writing down rules. Go forward or back, next switch said how far, ect. ect. Now with last years floor… We never perfected it.
Maybe this year?
-Rion