Log in

View Full Version : Autonomous Program Switch


Imadapocalypse
09-01-2010, 19:54
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.

ATannahill
09-01-2010, 20:05
Since the robot responds to on board sensors, it sounds very possible.

EricH
09-01-2010, 20:05
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.
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.)

AcesJames
09-01-2010, 20:07
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.

DanDon
09-01-2010, 20:28
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.

miniman
09-01-2010, 20:45
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).

Imadapocalypse
09-01-2010, 20:50
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.

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?

Enigma's puzzle
09-01-2010, 22:40
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).

apalrd
09-01-2010, 22:48
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.

Chris Fultz
10-01-2010, 10:12
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.

Big Kid
10-01-2010, 10:29
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.

PhilBot
10-01-2010, 10:42
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....

http://www.chiefdelphi.com/media/papers/2209

Big Kid
10-01-2010, 15:03
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

Greg McKaskle
10-01-2010, 15:30
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

jsasaki
10-01-2010, 15:39
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 :D

See you in Arizona
Good luck teams!

yara92
10-01-2010, 15:49
we use this in FRC 2009
see pic

Al Skierkiewicz
12-01-2010, 07:54
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.

Andrew Morris
12-01-2010, 10:18
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.

Racer26
12-01-2010, 13:13
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.

Rion Atkinson
12-01-2010, 13:47
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.

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? :D

-Rion

Dennis Erickson
11-02-2010, 19:58
If you want a very simple solution you can use the USER1 switch on the cRIO. Using the "FRC ReadSwitch.vi" will return its position. This is a very small switch and you should be carefull when using it. Do not move the other switches in the area.

Heath
12-02-2010, 15:00
Last year, our team made a box with three switches that we connected to the digital IO sidecar that gave us more possible autonomous modes than we actually used. However, we discovered a little to late that there was actually a pre-made block to determine your starting position in the WPI robotics library. It may still be applicable this year.

Alan Anderson
12-02-2010, 15:11
...there was actually a pre-made block to determine your starting position in the WPI robotics library.

It only tells you which spot in the alliance station your controls are assigned to. It doesn't have anything to do with where on the field your robot starts.